<?php
class IndexController extends Zend_Controller_Action
{
	/**
	 * The default action - show the home page
	 */
	public function init(){
		$this->view->title = Zend_Registry::get('translate')->translate("Header title");
   		$this->view->headTitle($this->view->title, 'PREPEND');
	}
	/**
	 * Main function
	 */
    public function indexAction(){
		$layout = new Ofx_Layout($this->getRequest());

		//tree grid
		$column = new PhpExt_Tree_Columns();
		$column->addColumn(PhpExt_Grid_ColumnConfigObject::createColumn("Task","task","task",160, null, null, true, false));
		$column->addColumn(PhpExt_Grid_ColumnConfigObject::createColumn("Duration","duration","duration",160, null, null, true, false));
		
		
		$treeGrid = new PhpExtUx_Tree_TreeGrid();
		
		$treeGrid->setTitle("tree grid")
				 ->setWidth(500)				 
				 ->setColumnsVariable(PhpExt_Javascript::variable('treeColumn'))
				 ->dataUrl("http://officex/treegrid-data.php");
		$treeGrid->setEnableDd(true);
		
		$layout->setOutput($treeGrid->getJavascript(false, "treeGrid"));
				
		// Center Region		
		$center = new PhpExt_TabPanel();
		
		$tabLayout = new PhpExt_Layout_TabLayout();
		$tabLayout->setDeferredRender(true);	

		$center->setActiveTab(0)
		       ->setLayout($tabLayout)
		       ->addItem($treeGrid);		       
		
		$layout->setViewport($center);
		
		$this->view->layout= Ofx_Extjs::onReady($layout->getLayout());
    }
    
	
    
}

